package com.idealighter.game.core.dao.generate.mapper;

import com.idealighter.game.core.dao.generate.domain.PlayerInfoDomain;
import com.idealighter.game.core.dao.generate.domain.PlayerInfoDomainExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface PlayerInfoDomainMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_info
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @SelectProvider(type=PlayerInfoDomainSqlProvider.class, method="countByExample")
    long countByExample(PlayerInfoDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_info
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @DeleteProvider(type=PlayerInfoDomainSqlProvider.class, method="deleteByExample")
    int deleteByExample(PlayerInfoDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_info
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Delete({
        "delete from player_info",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_info
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Insert({
        "insert into player_info (player_id, games, ",
        "sex, name, idcard, ",
        "weixin, age, birth_month, ",
        "birth_day, province, ",
        "city, addr, signature, ",
        "welfare)",
        "values (#{playerId,jdbcType=BIGINT}, #{games,jdbcType=VARCHAR}, ",
        "#{sex,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR}, ",
        "#{weixin,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{birthMonth,jdbcType=INTEGER}, ",
        "#{birthDay,jdbcType=INTEGER}, #{province,jdbcType=VARCHAR}, ",
        "#{city,jdbcType=VARCHAR}, #{addr,jdbcType=VARCHAR}, #{signature,jdbcType=VARCHAR}, ",
        "#{welfare,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(PlayerInfoDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_info
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @InsertProvider(type=PlayerInfoDomainSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(PlayerInfoDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_info
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @SelectProvider(type=PlayerInfoDomainSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="player_id", property="playerId", jdbcType=JdbcType.BIGINT),
        @Result(column="games", property="games", jdbcType=JdbcType.VARCHAR),
        @Result(column="sex", property="sex", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="idcard", property="idcard", jdbcType=JdbcType.VARCHAR),
        @Result(column="weixin", property="weixin", jdbcType=JdbcType.VARCHAR),
        @Result(column="age", property="age", jdbcType=JdbcType.INTEGER),
        @Result(column="birth_month", property="birthMonth", jdbcType=JdbcType.INTEGER),
        @Result(column="birth_day", property="birthDay", jdbcType=JdbcType.INTEGER),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="addr", property="addr", jdbcType=JdbcType.VARCHAR),
        @Result(column="signature", property="signature", jdbcType=JdbcType.VARCHAR),
        @Result(column="welfare", property="welfare", jdbcType=JdbcType.VARCHAR)
    })
    List<PlayerInfoDomain> selectByExample(PlayerInfoDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_info
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Select({
        "select",
        "id, player_id, games, sex, name, idcard, weixin, age, birth_month, birth_day, ",
        "province, city, addr, signature, welfare",
        "from player_info",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="player_id", property="playerId", jdbcType=JdbcType.BIGINT),
        @Result(column="games", property="games", jdbcType=JdbcType.VARCHAR),
        @Result(column="sex", property="sex", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="idcard", property="idcard", jdbcType=JdbcType.VARCHAR),
        @Result(column="weixin", property="weixin", jdbcType=JdbcType.VARCHAR),
        @Result(column="age", property="age", jdbcType=JdbcType.INTEGER),
        @Result(column="birth_month", property="birthMonth", jdbcType=JdbcType.INTEGER),
        @Result(column="birth_day", property="birthDay", jdbcType=JdbcType.INTEGER),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="addr", property="addr", jdbcType=JdbcType.VARCHAR),
        @Result(column="signature", property="signature", jdbcType=JdbcType.VARCHAR),
        @Result(column="welfare", property="welfare", jdbcType=JdbcType.VARCHAR)
    })
    PlayerInfoDomain selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_info
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=PlayerInfoDomainSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") PlayerInfoDomain record, @Param("example") PlayerInfoDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_info
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=PlayerInfoDomainSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") PlayerInfoDomain record, @Param("example") PlayerInfoDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_info
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=PlayerInfoDomainSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(PlayerInfoDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_info
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Update({
        "update player_info",
        "set player_id = #{playerId,jdbcType=BIGINT},",
          "games = #{games,jdbcType=VARCHAR},",
          "sex = #{sex,jdbcType=VARCHAR},",
          "name = #{name,jdbcType=VARCHAR},",
          "idcard = #{idcard,jdbcType=VARCHAR},",
          "weixin = #{weixin,jdbcType=VARCHAR},",
          "age = #{age,jdbcType=INTEGER},",
          "birth_month = #{birthMonth,jdbcType=INTEGER},",
          "birth_day = #{birthDay,jdbcType=INTEGER},",
          "province = #{province,jdbcType=VARCHAR},",
          "city = #{city,jdbcType=VARCHAR},",
          "addr = #{addr,jdbcType=VARCHAR},",
          "signature = #{signature,jdbcType=VARCHAR},",
          "welfare = #{welfare,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(PlayerInfoDomain record);
}